import Vue from 'vue'
import VueRouter from 'vue-router'



Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        redirect:"/overview/domestic"
    },
    {
        path: '/about',
        name: 'About',
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        path: '/test',
        name: 'Test',
        component: () =>
            import ('../views/test.vue')
    },
    {
        path: '/user/login',
        name: 'Login',
        component: () =>
            import ('../views/Login')
    },
    {
        path: '/user/register',
        name: 'Register',
        component: () =>
            import ('../views/Register')
    },
    {
        path: '/user/center',
        name: 'Center',
        component: () =>
            import ('../views/Center')
    },
    {
        path: '/article/:id',
        name: "Article",
        component: () =>
            import ('../views/public/Article/ContentPage')
    },
    {
        path: '/news',
        name: 'newNews',
        component: () => import('../views/public/Article/newNews')
    },
    {
        path: '/post/:id',
        name: 'Post',
        component: ()=> import('../views/public/Article/Post')
    },
    {
        path: '/knowledge',
        name: 'knowledge',
        component: ()=> import('../views/public/Article/Knowledge')
    },
    {
        path: '/policy',
        name: 'policy',
        component: ()=> import('../views/public/Article/Policy')
    },
    {
      path: '/discuss',
        name: 'discuss',
        component: ()=> import('../views/public/Article/Discuss')
    },
    {
        path: '/feed/news',
        name: "News",
        component: () =>
            import ("../views/public/Article/News")
    }, {
        path: '/feed/updates',
        name: "Announcements",
        component: () =>
            import ("../views/public/Article/Announcements")
    }, {
        path: '/feed/knowledge',
        name: "Knowledge",
        component: () =>
            import ("../views/public/Article/Knowledge")
    }, {
        path: '/feed/rumors',
        name: "Rumors",
        component: () =>
            import ("../views/public/Article/Rumors")
    },
    {
        path: '/manage/article/edit/:id',
        name: "ArticleEdit",
        component: () =>
            import ('../views/manage/ArticleEdit')
    },{
        path: '/manage/auth/apply',
        name: "AuthApply",
        component: () =>
            import ('../views/manage/AuthApply')
    },
    {
        path: '/manage/article/create',
        name: "ArticleCreate",
        component: () =>
            import ('../views/manage/ArticleEdit')
    },
    {
        path: '/overview',
        name: 'overview root',
        component: () =>
            import ('../views/public/Overview/Overview'),
        children: [{
                path: 'global',
                name: 'global overview',
                component: () =>
                    import ('../views/public/Overview/GlobalOverview'),
            },
            {
                path: 'domestic',
                name: 'china overview',
                component: () =>
                    import ('../views/public/Overview/ChinaMap')
            },
            {
                path: 'RiskTrip',
                name: 'RiskTrip',
                component: () =>
                    import('../views/public/Overview/RiskTrip')
            }

        ]
    }
]

const router = new VueRouter({
    routes
})

export default router
